﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace BiffenGUI
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new frmMember());
            //Application.Run(new testForm());

        }
    }

    public static class Tools
    {
        public static bool ValidateKeyPressAsNumber(KeyEventArgs e)
        {
            bool suppress = false;

            // Determine whether the keystroke is a number from the top of the keyboard.
            if (e.KeyCode < Keys.D0 || e.KeyCode > Keys.D9)
            {
                // Determine whether the keystroke is a number from the keypad.
                if (e.KeyCode < Keys.NumPad0 || e.KeyCode > Keys.NumPad9)
                {
                    // Determine whether the keystroke is a backspace, delete or shift.
                    if (e.KeyCode != Keys.Back && e.KeyCode != Keys.Delete && e.KeyCode != Keys.ShiftKey && e.KeyCode != Keys.Home && e.KeyCode != Keys.End)
                    {
                        // Determine whether the keystroke is from arrow keys.
                        if (e.KeyCode != Keys.Up && e.KeyCode != Keys.Down && e.KeyCode != Keys.Left && e.KeyCode != Keys.Right)
                        {
                            // A non-numerical keystroke was pressed.
                            // Set the flag to true and evaluate in KeyPress event.
                            suppress = true;
                        }
                    }
                }
            }

            return suppress;
        }
    }
}
